import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';

import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {HomeComponent} from "./pages/home/home.component";
import {DetectComponent} from "./pages/detect/detect.component";
import {PersonageComponent} from "./pages/detect/personage/personage.component";
import {WarshipComponent} from "./pages/detect/warship/warship.component";
import {JetComponent} from "./pages/detect/jet/jet.component";
import {LoginState} from "./state/login.state";
import {NgxsModule} from "@ngxs/store";
import {environment} from "../environments/environment";
import {NZ_I18N} from 'ng-zorro-antd/i18n';
import {zh_CN} from 'ng-zorro-antd/i18n';
import {HTTP_INTERCEPTORS, HttpClientModule} from "@angular/common/http";
import {AuthInterceptor} from "./core/auth.interceptor";
import {IconsProviderModule} from "./icons-provider.module";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {DragDropUploadDirective} from "./directives/drag-drop-upload.directive";
import {NzMessageModule, NzModalModule, NzSpinModule} from "ng-zorro-antd";
import {DetectState} from "./state/detect.state";
import {WebsocketService} from "./core/websocket.service";
import {OssPathPipe, SampleOssPathPipe, SceneTypePipe, SafePipe, AdminUrlPipe} from "./app.pipes";
import {RecognizeState} from "./state/recognize.state";
import {VideoState} from "./state/video.state";
import {FfdecWasmLoaderService} from "./ffdec-wasm-loader.service";
import {VideoService} from "./video.service";
import {VideoCanvasComponent} from "./pages/detect/video-canvas.component";
import {SsoComponent} from "./pages/sso/sso.component";
import {FormsModule} from "@angular/forms";

@NgModule({
  declarations: [
    AppComponent, HomeComponent, DetectComponent, PersonageComponent, WarshipComponent, JetComponent, SsoComponent,
    DragDropUploadDirective, OssPathPipe, SceneTypePipe, SafePipe, VideoCanvasComponent, SampleOssPathPipe, AdminUrlPipe
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    IconsProviderModule,
    HttpClientModule,
    BrowserAnimationsModule,
    NgxsModule.forRoot([LoginState, DetectState, RecognizeState, VideoState], {
      developmentMode: !environment.production
    }),
    NzSpinModule, NzMessageModule, NzModalModule, FormsModule
  ],
  providers: [
    {
      provide: NZ_I18N, useValue: zh_CN
    },
    {
      provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true
    },
    WebsocketService, FfdecWasmLoaderService, VideoService,
    OssPathPipe
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}
